package org.ticketing.controller;

import javax.persistence.*;

import org.ticketing.model.*;

public class PackageManager {

	public void purchase(String username, int packageId) {
		EntityManagerFactory factory = Persistence.createEntityManagerFactory("DB");
		EntityManager manager = factory.createEntityManager();
		
		// manager.persist(new Package(username, packageId));
	}

	public void sendMail(String username) {
		EntityManagerFactory factory = Persistence.createEntityManagerFactory("DB");
		EntityManager manager = factory.createEntityManager();
		
		User user = manager.find(User.class, username);
		// Send a mail to user's mail address
	}

}
